<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<title>局部组件</title>
		<script src="js/vue.js" type="text/javascript" charset="utf-8"></script>
	</head>
	<body>
		<div id="app">
			<my-component></my-component>
		</div>
		<script>
			let demo = {
				data: function() {
					return {
						msg: '局部组件'
					}
				},
				template: `
				   <div>
				    <h4>{{msg}}</h4>
				   </div>
				 `
			};

			let vm = new Vue({
				el: '#app',
				components: {
					'my-component': demo
				}
			});
		</script>
	</body>
</html>
